package org.openems.osa;

import java.awt.event.ItemListener;

import javax.swing.JComboBox;

public class SwingComboBox implements IComboBox {
	private JComboBox<String> comboBox = new JComboBox<String>();
	
	@Override
	public Integer getSelectedIndex() {
		return comboBox.getSelectedIndex();
	}

	@Override
	public void addItemListener(ItemListener itemListener) {
		this.comboBox.addItemListener(itemListener);
	}

	@Override
	public void removeItemListener(ItemListener itemListener) {
		this.comboBox.removeItemListener(itemListener);
	}

	@Override
	public void removeAllItems() {
		this.comboBox.removeAllItems();
	}

	@Override
	public void addItem(String s) {
		this.comboBox.addItem(s);
	}

	@Override
	public void setSelectedIndex(Integer index) {
		this.comboBox.setSelectedIndex(index);
	}

	@Override
	public Object getUi() {
		return this.comboBox;
	}

}
